package sysman.user.web;

import org.apache.struts2.osgi.interceptor.BundleContextAware;
import org.osgi.framework.BundleContext;

import sysman.user.service.UserService;

import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport implements BundleContextAware {

	private static final long serialVersionUID = 1L;

	BundleContext bundleContext;

	private UserService userService;
	
	private String userId;
	private String userName;
	private String password;
	
	public void setBundleContext(BundleContext bundleContext) {
		// TODO Auto-generated method stub
		this.bundleContext = bundleContext;
	}

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String execute() {
		return SUCCESS;
	}
	
	public String toLogin() {
		return SUCCESS;
	}
	
	public String toHome() throws Exception {
		if(userService != null) {
			userService.getUserById("test");
		} else {
		
		}
		return SUCCESS;
	}
	
	public String toJsp() {
		return SUCCESS;
	}

	
}
